fastcgi_cache_path /mydata/nginx/cache/{{vhost.key}} levels=1:2 keys_zone={{vhost.key}}:100m inactive=60m;
server {
    listen {{vhost.listen}};
    server_name {{vhost.server_name}};
    location / {
        root "/mydata/www/{{vhost.path}}";
        index index.html index.htm index.php;
    }
    error_page 500 502 503 504 /50x.html;
    location = /50x.html {
        root /usr/share/nginx/html;
    }
    location ~ \.php$ {
        include fastcgi_params;
        fastcgi_pass  {{ nginx.phpfpm_addr_port if nginx.phpfpm_unix is undefined else nginx.phpfpm_unix}};
        fastcgi_index index.php;
        fastcgi_param SCRIPT_FILENAME "/mydata/www/{{vhost.path}}$fastcgi_script_name";
        fastcgi_keep_conn on;
        fastcgi_cache {{vhost.key}};
        fastcgi_cache_key $request_uri;
        fastcgi_cache_valid 200 302 60m;
        fastcgi_cache_valid 301 1h;
        fastcgi_cache_valid any 1m;

    }
    location ~*  ^/(pmstatus|ping)$  {
        include fastcgi_params;
        fastcgi_pass  {{ nginx.phpfpm_addr_port if nginx.phpfpm_unix is undefined else nginx.phpfpm_unix}}; 
        fastcgi_param SCRIPT_FILENAME $fastcgi_script_name;
    }

}
